package nsd.test.zy02;

public class Rectangle {
    private int length;
    private int width;

    public Rectangle(int length, int width) {
        this.length = length;
        this.width = width;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getArea(int length,int width){
        int area=length*width;
        return area;
    }

    public int getPer(int length,int width){
        int per=2*(length+width);
        return per;
    }

    public void showAll(){
        System.out.println("长："+length);
        System.out.println("宽："+width);
        System.out.println("面积："+getArea(length,width));
        System.out.println("周长："+getPer(length,width));
    }

}
